<!--{template admin/header}-->
<body id="homepage">
    <div id="breadcrumb">
        <ul>
            <li><img src="static/img/icons/icon_breadcrumb.png"
                     alt="Location" /></li>
            <li><strong>位置:</strong></li>
            <li><a href="admin.php">主页</a> - 热门日记</li>
        </ul>
    </div>
    <div id="rightside" class="diary_list">
        <div class="contentcontainer">
            <div class="headings altheading">
                <h3>线上热门日记</h3>
            </div>
			<!-- div class="contentbox">
				<div class="extrabottom">
					<form method="get" action="admin.php" class="form-inline" role="form" >
						<div class="input-prepend">
							<span class="add-on">BodyId</span>
							<input class="span2" id="prependedInput" type="text"  name="bodyId" >
						</div>
						<div class="input-prepend">
							<span class="add-on">权重</span>
							<input class="span2" type="text"  name="score"  >
						</div>
						<div class="input-prepend">
							<input type="hidden" name="ac" value="manage" />
							<input type="hidden" name="op" value="addHotDiaryData" />
							<input type="submit" value="添加" class="btn btn_add"/>
						</div>
					</form>
				</div>
			</div -->
            <div id="hotdiary" class="contentbox">
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>作者</th>
                            <th>内容</th>
                            <th>自动回复</th>
                            <th>评论数</th>
                            <th>喜欢数</th>
                            <th>查看数</th>
                            <th>附件</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody class="diary-list">
                    	<!--{eval $i=1;}-->
                        <!--{loop $list $value}-->
                        <tr id="tr_{$value[bodyId]}">
                        	<td><span class="label label-info"><!--{eval echo (($currtenPage - 1) * $perpage + ($i++)) }--></span></td>
                            <td><a href="admin.php?ac=user_profile&uid={$value[eUid]}"
                               title="{$value[eNickname]}" target="_blank"><!--{eval echo htmlspecialchars($value[eNickname]);}--></a> {if $value['detail']['user']['is_vip']==0}
								{else}
								<img style="width:40px;height:40px;" src="./static/images/vip/vip.png">
								{/if}
								{if $value['detail']['user']['is_ability']==0}
								{else}
								{if $value['detail']['user']['ability_level']==1}
								<img style="width:25px;height:24px;"  src="./static/images/ability/ability_s_1.png">
								{elseif $value['detail']['user']['ability_level']==2}
								<img  style="width:25px;height:24px;" src="./static/images/ability/ability_s_2.png">
								{elseif  $value['detail']['user']['ability_level']==3}
								<img  style="width:25px;height:24px;" src="./static/images/ability/ability_s_3.png">
								{elseif $value['detail']['user']['ability_level']==4}
								<img  style="width:25px;height:24px;" src="./static/images/ability/ability_s_4.png">
								{elseif $value['detail']['user']['ability_level']==5}
								<img  style="width:25px;height:24px;" src="./static/images/ability/ability_s_5.png">
								{/if}
								{/if}
								{if $value['detail']['user']['verified']==0}
								{else}
								<img style="width:25px;height:24px;" src="./static/images/vip/v.png">
								{/if}</td>
                            <td class="diary-content">
                            	<a href="admin.php?ac=diary&op=getDiaryAllInfo&bodyId={$value[bodyId]}&uid={$value[eUid]}" target="_blank">$value[content]</a>
                            </td>
                            <td>
                            	<a href="javascript:;" class="btn-autoreply" data-bodyId="{$value[bodyId]}"><span class="label label-success">点击添加</span></a>
                            </td>
                            <td>
                            	{$value[detail][commentTimes]}
                            </td>
                            <td>
                            	{$value[detail][likeTimes]}
                            </td>
                            <td>
                            	{$value[detail][viewTimes]}
                            </td>
                            <td>
								{if !$value['detail']['attachmentList']}
								-·-
								{else}
								{if $value['detail']['attachmentList']['attachmentType']=1}
								<span class="icon-picture"></span>
								{elseif $value['detail']['attachmentList']['attachmentType']=2}
								<img style="width:25px;height:24px;" src="./static/images/attachment/audio.png">
								{elseif $value['detail']['attachmentList']['attachmentType']=3}
								<img style="width:20px;height:18px;" src="./static/images/attachment/video.png">
								{/if}
								{/if}
                            </td>
                            <td>
                            	<a href="javascript:;" class="btn-delete" data-bodyId="{$value[bodyId]}"><span class="icon-remove"></span></a>
                            </td>
                        </tr>
                        <!--{/loop}-->
                    </tbody>
                </table>
                <div class="extrabottom">
                    <div class="bulkactions" style="float:right;">
                        <ul class="pagination">
                        	<li class="text">共{$totalPages}页，当前为第{$currtenPage}页 。</li>
							<!--{if $start < 450 || $start == 500}-->
							<li class="text"><a href="{$firstpurl}" title="">1</a></li>
							<li class="text"><a href="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=50" title="">2</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=100" title="">3</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=150" title="">4</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=200" title="">5</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=250" title="">6</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=300" title="">7</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=350" title="">8</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=400" title="">9</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=450" title="">10</a></li>
							<!--{elseif $start >= 450 && $start <= 1000 && $start != 950}-->
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=500" title="">11</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=550" title="">12</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=600" title="">13</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=650" title="">14</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=700" title="">15</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=750" title="">16</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=800" title="">17</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=850" title="">18</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=900" title="">19</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=950" title="">20</a></li>
							<!--{/if}-->
							<!--{if $start >= 950 && $start !=1000}-->
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=1000" title="">21</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=1050" title="">22</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=1100" title="">23</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=1150" title="">24</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=1200" title="">25</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=1250" title="">26</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=1300" title="">27</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=1350" title="">28</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=1400" title="">29</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=1450" title="">30</a></li>
							<li class="text"><a href ="admin.php?ac=manage&query=1&op=hotdiary&perpage=50&start=1500" title="">31</a></li>
							<!--{/if}-->
                        </ul>
                    </div>
                </div>
                <div style="clear: both;"></div>
            </div>
        </div>
    </div>
    <!--{template admin/leftside}-->
    <!--{template admin/footer}-->
    <script type="text/javascript">
    
	$(document).on("click",".btn-delete",function(){
		var data = $(this).data();
		var bodyid = data.bodyid;
		var tritem = 'tr_'+bodyid;
		
		$.get(  "admin.php", {
				bodyId : bodyid,
				ac	   : 'manage',
				op	   : 'delHotDiaryByBodyId'
				},function(data) {
					if (data == 1) {
						$("#"+tritem).hide();
					}
				});
	});
    
	$(document).on("click",".btn-autoreply",function(){
		var data = $(this).data();
		var bodyid = data.bodyid;
		
		$.get(  "http://autoreply.ffrj.net/qcreate/diary/"+bodyid, 
				null,
				function(data) {
					if (data.status == 1) {
						alert('添加成功');
					}
				});
	});
	
	$(document).on("click","#build-hot",function(){

		$.get(  "http://autoreply.ffrj.net/rank", 
				null,
				function(data) {
					if (data.status == 1) {
						alert('成功生成热门');
					}
				});
	});

	</script>